package tt.dz.biz.service.cardno;

import tt.dz.common.DZStringUtil;

public class DefaultCardNoProduct
  implements CardNoProduct
{
  private String cardBin;
  private String cardType;
  private String areaCode;
  private String signalCode;
  private String sequence;
  private String checkCode;
  private String merchantCode;
  
  public String getCardNo()
  {
    return this.cardBin + this.cardType + this.areaCode + this.signalCode + this.sequence + this.checkCode;
  }
  
  public String getArea()
  {
    return this.areaCode;
  }
  
  public String getSignalCode()
  {
    return this.signalCode;
  }
  
  public String getCardType()
  {
    return this.cardType;
  }
  
  public String getMerchantCode()
  {
    return this.merchantCode;
  }
  
  public String getSequence()
  {
    return this.sequence;
  }
  
  public String getCheckCode()
  {
    return this.checkCode;
  }
  
  public String getBin()
  {
    return this.cardBin;
  }
  
  public void createCheckCode()
  {
    this.checkCode = String.valueOf(DZStringUtil.createVerifyCode(getWouldCheckCardNo()));
  }
  
  private String getWouldCheckCardNo()
  {
    return this.cardBin + this.cardType + this.areaCode + this.signalCode + this.sequence;
  }
  
  public void setCardBin(String cardBin)
  {
    this.cardBin = cardBin;
  }
  
  public void setCardType(String cardType)
  {
    this.cardType = cardType;
  }
  
  public void setAreaCode(String areaCode)
  {
    this.areaCode = areaCode;
  }
  
  public void setSignalCode(String signalCode)
  {
    this.signalCode = signalCode;
  }
  
  public void setSequence(String sequence)
  {
    this.sequence = sequence;
  }
  
  public void setCheckCode(String checkCode)
  {
    this.checkCode = checkCode;
  }
  
  public void setMerchantCode(String merchantCode)
  {
    this.merchantCode = merchantCode;
  }
}
